package edu.uclmgmu.bacteriosec.aspects.java.io.FileOutputStream;

import java.io.FileOutputStream;

import edu.uclmgmu.bacteriosec.aspects.common.Store;

privileged aspect FileOutputStream_CountCalls {

	void around(java.io.FileOutputStream caller, byte[] a, int b, int c) : target(caller) && args(a, b, c) && 
			call(* FileOutputStream.write(byte[], int, int))  && 
			!cflow(within(FileOutputStream_CountCalls)) && !within(edu.uclmgmu.bacteriosec.aspects.common.Store) {
		Store.updateNumberOfCalls(thisJoinPointStaticPart.getSignature().toString());
		proceed(caller, a, b, c);
	}
	void around(java.io.FileOutputStream caller, byte[] a) : target(caller) && args(a) && 
			call(* FileOutputStream.write(byte[]))  && 
			!cflow(within(FileOutputStream_CountCalls)) && !within(edu.uclmgmu.bacteriosec.aspects.common.RMIStore) {
		Store.updateNumberOfCalls(thisJoinPointStaticPart.getSignature().toString());
		proceed(caller, a);
	}

}
